package com.example.springboot.service;

import com.example.springboot.Mapper.EbookSnapshotCustMapper;
import com.example.springboot.response.StatisticResponse;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class EbookSnapshotService {

    @Resource
    private EbookSnapshotCustMapper ebookSnapshotCustMapper;

    public void genSnapshot(){
        ebookSnapshotCustMapper.genSnapshot();
    }

    /*
    * 获取首页数据：总阅读数，总点赞数，今日阅读数，今日..
    * */
    public List<StatisticResponse> getStatistic(){
        return ebookSnapshotCustMapper.getStatistic();
    }

    /*
    * 30天数值统计
    * */
    public List<StatisticResponse> get30Statistic(){
        return ebookSnapshotCustMapper.get30Statistic();
    }
}
